﻿CREATE TABLE [dbo].[Post](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[ThreadId] [bigint] NOT NULL,
	[PosterId] [bigint] NOT NULL,
	[BoardId] [bigint] NOT NULL,
	[Poster] [nvarchar](50) NOT NULL,
	[Title] [nvarchar](100) NOT NULL,
	[PostTime] [datetime] NOT NULL DEFAULT (getdate()),
	[Content] [ntext] NOT NULL,
	[IP] [nvarchar](20) NOT NULL,
	[LastEdit] [nvarchar](50) NULL,
	[Invisible] [bit] NULL,
	[UsesIg] [bit] NULL,
	[HtmlOn] [bit] NULL,
	[UbbCodeOn] [bit] NULL,
	[Attachment] [bit] NULL,
	[Rate] [int] NOT NULL DEFAULT ((0)),
	[RateTimes] [int] NOT NULL DEFAULT ((0)),
 CONSTRAINT [PK_Post] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'帖子作者' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'Poster'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标题' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'Title'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'发表时间' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'PostTime'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否隐藏, 如果未通过审核则为隐藏' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'Invisible'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否启用签名' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'UsesIg'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否支持html' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'HtmlOn'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否支持UBB' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'UbbCodeOn'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'是否含有附件' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'Attachment'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'评分分数' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post', @level2type=N'COLUMN', @level2name=N'Rate'

GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'帖子表' ,@level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level1name=N'Post'